package com.syni.mdd.sjb.common.datatreaure.entity.vo.rp.databBankCommon;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
public class StatisticsDataRpVo {
    private String mainTitle;  //主标题

    private List<innerDataFirst>  innerDataList;

    public StatisticsDataRpVo() {
    }

    public StatisticsDataRpVo(String mainTitle, List<innerDataFirst> innerDataList) {
        this.mainTitle = mainTitle;
        this.innerDataList = innerDataList;
    }

    @Data
    public static class innerDataFirst{
        private String title;     //第一层框架大标题
        private String subTitle;  //第一层框架副标题
        //时间、数据
        private List<GetDataWithTime> timeDataList;

        public innerDataFirst() {
        }

        public innerDataFirst(String title, String subTitle, List<GetDataWithTime> timeDataList) {
            this.title = title;
            this.subTitle = subTitle;
            this.timeDataList = timeDataList;
        }
    }

    /**
     * 时间数组
     */
    @Data
    public static class GetDataWithTime{
        private String dateTitle;   //时间标题

        private String suggestion;  //建议

        private Integer mapType;  //统计图类型：0 （饼状图）1（折线图）2（双折线图）3（折现柱状比例图）

        private Integer yAxisType = 0;  //y轴数据单位：0:无单位;1:百分比

        private String xAxisFormat;  //x轴单位

        private String  summary;  //图片下面一行字

        private Integer location = 0;  //注释位置 0：下面  1：上方

        private SuggestionDetail remark;  //分析结果

        private List<DataDetail> dataDetailList;  //具体数值

        private List<NormalData> normalDataList;  //正态分布专属数据

        private List<TagExplain> tagExplainList;

        public GetDataWithTime() {
        }

        public GetDataWithTime(String dateTitle,SuggestionDetail remark,String suggestion, Integer mapType, String summary, List<DataDetail> dataDetailList, List<NormalData> normalDataList, List<TagExplain> tagExplainList) {
            this.dateTitle = dateTitle;
            this.remark = remark;
            this.suggestion = suggestion;
            this.mapType = mapType;
            this.summary = summary;
            this.dataDetailList = dataDetailList;
            this.normalDataList = normalDataList;
            this.tagExplainList = tagExplainList;
        }

        public GetDataWithTime(String dateTitle,SuggestionDetail remark,String suggestion, Integer mapType, Integer yAxisType, String xAxisFormat, String summary, Integer location, List<DataDetail> dataDetailList, List<NormalData> normalDataList, List<TagExplain> tagExplainList) {
            this.dateTitle = dateTitle;
            this.remark =remark;
            this.suggestion = suggestion;
            this.mapType = mapType;
            this.yAxisType = yAxisType;
            this.xAxisFormat = xAxisFormat;
            this.summary = summary;
            this.location = location;
            this.dataDetailList = dataDetailList;
            this.normalDataList = normalDataList;
            this.tagExplainList = tagExplainList;
        }
    }

    @Data
    public static class TagExplain{
        private String tagName;  //下面注释名字

        private String color; //颜色编码

        public TagExplain() {
        }

        public TagExplain(String tagName, String color) {
            this.tagName = tagName;
            this.color = color;
        }
    }

    @Data
    public static class NormalData{
        private Double xLeftValue;  //柱状图左边X值

        private Double yLeftValue;  //柱状图左边Y值

        private Double xRightValue;  //柱状图右边数值

        private Double yRightValue;  //柱状图右边Y值

        private String color;  //颜色编码

        private List<String> popContent; //弹出内容

        public NormalData() {
        }

        public NormalData(Double xLeftValue, Double yLeftValue, Double xRightValue, Double yRightValue, String color) {
            this.xLeftValue = xLeftValue;
            this.yLeftValue = yLeftValue;
            this.xRightValue = xRightValue;
            this.yRightValue = yRightValue;
            this.color = color;
        }

        public NormalData(Double xLeftValue, Double yLeftValue, Double xRightValue, Double yRightValue, String color, List<String> popContent) {
            this.xLeftValue = xLeftValue;
            this.yLeftValue = yLeftValue;
            this.xRightValue = xRightValue;
            this.yRightValue = yRightValue;
            this.color = color;
            this.popContent = popContent;
        }
    }


    /**
     * 具体数据
     */
    @Data
    public static class DataDetail{
        private String dataTitle;  //数据标题

        private String smallTitle;  //小标题

        private Double contentData;  //数据数值

        private Double dataRatio;  //数据占比

        private String color;  //样式

        private List<String> popContent;  //弹窗内容

        private List<SuggestionDetail> remark;  //分析结果

        public DataDetail() {
        }

        public DataDetail(String dataTitle, String smallTitle, Double contentData, Double dataRatio, String color, List<String> popContent) {
            this.dataTitle = dataTitle;
            this.smallTitle = smallTitle;
            this.contentData = contentData;
            this.dataRatio = dataRatio;
            this.color = color;
            this.popContent = popContent;
        }

    }

    @Data
    public static class SuggestionDetail{
        private String text;
        private String highLightText;
        private String clickUrl;

        public SuggestionDetail() {
        }

        public SuggestionDetail(String text, String highLightText, String clickUrl) {
            this.text = text;
            this.highLightText = highLightText;
            this.clickUrl = clickUrl;
        }
    }
}
